"set vim as python IDE
setlocal tabstop=4
setlocal softtabstop=4
setlocal shiftwidth=4
setlocal textwidth=79
setlocal nosmartindent
setlocal expandtab

"call F5 to run python script
noremap <F5> <esc>:w<cr>:!python %<cr>
"call F8 to toggle tags
nnoremap <F8> :TagbarToggle<CR>
"add python highlight
autocmd BufRead,BufNewFile *.py let python_highlight_all=1

"handler python file trail space
func! DeleteTrailingWS()
  exe "normal mz"
  %s/\s\+$//ge
  exe "normal `z"
endfunc
au BufWrite *.py :call DeleteTrailingWS()

func! Pyheader()
  exe "0r ~/.vim/header/pyheader"
  exe "normal G"
endfunc

iab im import
iab cl class
iab pr print
imap ; :
